home *** CD-ROM | disk | FTP | other *** search
/ Champak 26 (Anniversary Edition) / Volume 26 [Anniversary Edition] - JOGO DISK .iso / DEPOSITO / REmovido / Esportes / BowlingMaster.swf / scripts / DefineSprite_71 / frame_1 / DoAction.as
Text File  |  2006-06-13  |  2KB  |  76 lines

  1. this.onEnterFrame = function()
  2. {
  3.    i = 1;
  4.    while(i <= 22)
  5.    {
  6.       if(_root["x" + i].text == "X")
  7.       {
  8.          cont = 0;
  9.          suma = 0;
  10.          j = 1;
  11.          while(j <= 4)
  12.          {
  13.             if(_root.scorVect[i + j] != -1)
  14.             {
  15.                locCont = i + j;
  16.                if(_root["x" + locCont].text == "/")
  17.                {
  18.                   suma += 10 - _root.scorVect[i + j - 1];
  19.                }
  20.                else
  21.                {
  22.                   suma += _root.scorVect[i + j];
  23.                }
  24.                cont++;
  25.                if(cont == 2)
  26.                {
  27.                   j = 5;
  28.                }
  29.             }
  30.             j++;
  31.          }
  32.          if(cont == 2)
  33.          {
  34.             locCont = i - 1;
  35.             _root["s" + locCont].text = 10 + suma;
  36.             _root.sTot += 10 + suma;
  37.             _root.total.text = _root.Stot;
  38.             _root["x" + i].text = " X ";
  39.          }
  40.       }
  41.       i++;
  42.    }
  43.    i = 1;
  44.    while(i <= 22)
  45.    {
  46.       if(_root["x" + i].text == "/")
  47.       {
  48.          cont = 0;
  49.          suma = 0;
  50.          j = 1;
  51.          while(j <= 2)
  52.          {
  53.             if(_root.scorVect[i + j] != -1)
  54.             {
  55.                suma += _root.scorVect[i + j];
  56.                cont++;
  57.                if(cont == 1)
  58.                {
  59.                   j = 3;
  60.                }
  61.             }
  62.             j++;
  63.          }
  64.          if(cont == 1)
  65.          {
  66.             locCont = i - 1;
  67.             _root["s" + locCont].text = 10 + suma;
  68.             _root.sTot += 10 + suma - _root.scorVect[i - 1];
  69.             _root.total.text = _root.Stot;
  70.             _root["x" + i].text = " / ";
  71.          }
  72.       }
  73.       i++;
  74.    }
  75. };
  76.